package pme;

public class Average extends Value{
	private double currNum;
 	
	/** 
	 * determines the arithmetic average of two values
	 * 
	 * @param initVal1
	 * @param initVal2
	 */
	public Average(Value initVal1, Value initVal2){
		if (initVal1==null) initVal1= new NullValue();
		if (initVal2==null) initVal2= new NullValue();
		
	 currNum = (initVal1.evaluate() + initVal2.evaluate())/2;
	}
		
	public double evaluate(){
		return currNum;
	}
}
